package au.com.handsunited.dao.hibernate;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import au.com.handsunited.dao.GroupDAO;
import au.com.handsunited.model.Group;

/**
 *
 * @author arunda
 */
public class GroupDAOHibernate extends EntityDAOHibernate implements
		GroupDAO {

	private static Logger logger = LoggerFactory.getLogger(GroupDAOHibernate.class);

	/**
	 * @see au.com.handsunited.dao.impl.GroupDAO#createGroup(au.com.handsunited.model.Group)
	 */
	@Override
	public Group createGroup(Group group) {
		return (Group) createEntity(group);
	}

	/**
	 * @see au.com.handsunited.dao.impl.GroupDAO#findGroupsByKeywords(java.lang.String)
	 */
	@Override
	public List<Group> findGroupsByKeywords(String keywords) {
		return getGroups();
	}

	/**
	 * @see au.com.handsunited.dao.impl.GroupDAO#getGroup(java.lang.Long)
	 */
	@Override
	public Group getGroup(Long groupId) {
		return (Group) getEntity(groupId, Group.class);
	}

	/**
	 * @see au.com.handsunited.dao.impl.GroupDAO#getGroups()
	 */
	@Override
	public List<Group> getGroups() {
		return getHibernateTemplate().find("from Group");
	}

	/**
	 * @see au.com.handsunited.dao.impl.GroupDAO#updateProject(au.com.handsunited.model.Group)
	 */
	@Override
	public Group updateProject(Group group) {
		return (Group) updateEntity(group);
	}

}
